#![feature(linkage)]

use abi_macro::api_trait;

#[repr(C)]
pub struct Food {
    pub count: usize,
}

#[api_trait]
pub trait Cat {
    fn eat(food: Food) -> usize;

    fn jump() -> usize {
        println!("default jump");
        1
    }
}

/// Only one kind of cat, so no need to known type.
pub fn cat_eat(food: Food) -> usize {
    CatImpl::eat(food)
}

pub fn cat_jump() -> usize {
    CatImpl::jump()
}
